package com.jarvan.model;


import com.jarvan.enums.PayEnum;
import com.jarvan.enums.TicketEnum;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@Data
@Table(indexes = {@Index(columnList = "buyerId"),@Index(columnList = "trainId")})
public class Ticket {

    @Id
    private String ticketId;

    private String trainId;

    private Integer buyerId;
    /**
     * 始发站
     */
    private String departureStation;
    /**
     * 终点站
     */
    private String destination;
    /**
     * 出发时间
     */
    private String departureTime;
    /**
     * 到达时间
     */
    private String destinationTime;
    /**
     * 出发日期
     */
    private String departureDate;
    /**
     * 票价
     */
    private BigDecimal ticketAmount;
    /**
     * 座位类型
     */
    private Integer seatType;
    /**
     * 车厢号
     */
    private Integer carriageNum;
    /**
     * 座位号
     */
    private Integer seatNum;
    /**
     * 车票状态
     */
    private Integer ticketStatus = TicketEnum.NEW.getCode();
    /**
     * 支付状态
     */
    private Integer payStatus = PayEnum.NEW.getCode();


}
